Interface: PeerConnection
Hierarchy
↳
PeerConnection
Properties
answerOptions
• answerOptions: undefined
| RTCAnswerOptions
Inherited from
BasePeerConnection.answerOptions
bandwidth
• bandwidth: Bandwidth
Inherited from
close
• close: () => void
Type declaration
▸ (): void
Returns
void
Inherited from
configs
• configs: MediaConfig
[]
Inherited from
connectionState
• connectionState: RTCPeerConnectionState
Inherited from
BasePeerConnection.connectionState
createDataChannel
• createDataChannel: (label
: string
, dataChannelDict?
: RTCDataChannelInit
) => RTCDataChannel
Type declaration
▸ (label
, dataChannelDict?
): RTCDataChannel
Parameters
Name | Type |
---|---|
label | string |
dataChannelDict? | RTCDataChannelInit |
Returns
RTCDataChannel
Inherited from
BasePeerConnection.createDataChannel
currentLocalDescription
• currentLocalDescription: null
| RTCSessionDescription
currentRemoteDescription
• currentRemoteDescription: null
| RTCSessionDescription
getConfiguration
• getConfiguration: () => RTCConfiguration
Type declaration
▸ (): RTCConfiguration
Returns
RTCConfiguration
Inherited from
BasePeerConnection.getConfiguration
getDataChannelConfigs
• getDataChannelConfigs: () => DataChannelConfig
[]
Type declaration
▸ (): DataChannelConfig
[]
Returns
Inherited from
BasePeerConnection.getDataChannelConfigs
getTransceiverConfigs
• getTransceiverConfigs: () => TransceiverConfig
[]
Type declaration
▸ (): TransceiverConfig
[]
Returns
Inherited from
BasePeerConnection.getTransceiverConfigs
hasICECandidates
• hasICECandidates: boolean
Inherited from
BasePeerConnection.hasICECandidates
iceConnectionState
• iceConnectionState: RTCIceConnectionState
Inherited from
BasePeerConnection.iceConnectionState
iceGatheringState
• iceGatheringState: RTCIceGatheringState
Inherited from
BasePeerConnection.iceGatheringState
negotiationNeeded
• negotiationNeeded: boolean
offerOptions
• offerOptions: undefined
| RTCOfferOptions
Inherited from
BasePeerConnection.offerOptions
onConnectionStateChange
• Optional
onConnectionStateChange: EventHandler
onDataChannel
• Optional
onDataChannel: null
| (this
: RTCPeerConnection
, ev
: RTCDataChannelEvent
) => any
onIceCandidate
• Optional
onIceCandidate: OnIceCandidateHandler
onIceCandidateError
• Optional
onIceCandidateError: null
| (this
: RTCPeerConnection
, ev
: Event
) => any
onIceConnectionStateChange
• Optional
onIceConnectionStateChange: EventHandler
onIceGatheringStateChange
• Optional
onIceGatheringStateChange: EventHandler
onNegotiationNeeded
• Optional
onNegotiationNeeded: OnNegotiationNeededHandler
onRemoteStreams
• Optional
onRemoteStreams: OnRemoteStreamsEventHandler
onSecureCheckCode
• Optional
onSecureCheckCode: OnSecureCheckCodeHandler
onSignalingStateChange
• Optional
onSignalingStateChange: EventHandler
onTrack
• Optional
onTrack: OnTrackEventHandler
onTransceiverChange
• Optional
onTransceiverChange: OnTransceiverChangeHandler
peer
• peer: ExtendedRTCPeerConnection
Inherited from
pendingLocalDescription
• Optional
pendingLocalDescription: RTCSessionDescription
| RTCSessionDescriptionInit
It represents a local description that is in the process of being
negotiated plus any local candidates that have been generated by the ICE
Agent since the offer or answer was created. If the RTCPeerConnection
is in the stable state, the value is null
.
https://w3c.github.io/webrtc-pc/#dom-peerconnection-pendinglocaldesc
pendingRemoteDescription
• pendingRemoteDescription: null
| RTCSessionDescription
It represents a remote description that is in the process of being
negotiated, complete with any remote candidates that have been supplied
via addIceCandidate()
since the offer or answer was created. If the
RTCPeerConnection
is in the stable state, the value is null
.
https://w3c.github.io/webrtc-pc/#dom-peerconnection-pendingremotedesc
polite
• polite: boolean
Inherited from
receivers
• receivers: RTCRtpReceiver
[]
Inherited from
references
• references: References
Reference of any logical associations to the peer connection for logging
Inherited from
restartIce
• restartIce: () => void
Type declaration
▸ (): void
Returns
void
Inherited from
senders
• senders: RTCRtpSender
[]
Inherited from
setConfiguration
• setConfiguration: undefined
| (configuration?
: RTCConfiguration
) => void
Only recently supported on some browser: https://caniuse.com/?search=setconfiguration
Inherited from
BasePeerConnection.setConfiguration
signalingState
• signalingState: RTCSignalingState
Inherited from
BasePeerConnection.signalingState
Methods
addConfig
▸ addConfig(peer
, initOrConfig
): DataChannelConfig
Parameters
Name | Type |
---|---|
peer | RTCPeerConnection |
initOrConfig | DataChannelConfig | DataChannelInit |
Returns
Inherited from
▸ addConfig(peer
, initOrConfig
): TransceiverConfig
Parameters
Name | Type |
---|---|
peer | RTCPeerConnection |
initOrConfig | TransceiverConfig | TransceiverInit |
Returns
Inherited from
▸ addConfig(peer
, initOrConfig
): TransceiverConfig
| DataChannelConfig
Parameters
Name | Type |
---|---|
peer | RTCPeerConnection |
initOrConfig | TransceiverConfig | DataChannelConfig | DataChannelInit | TransceiverInit |
Returns
TransceiverConfig
| DataChannelConfig
Inherited from
createAnswer
▸ createAnswer(options?
): Promise
<RTCSessionDescriptionInit
>
Parameters
Name | Type |
---|---|
options? | RTCAnswerOptions |
Returns
Promise
<RTCSessionDescriptionInit
>
createOffer
▸ createOffer(options?
): Promise
<RTCSessionDescriptionInit
>
Parameters
Name | Type |
---|---|
options? | RTCOfferOptions |
Returns
Promise
<RTCSessionDescriptionInit
>
getStats
▸ getStats(selector?
): Promise
<RTCStatsReport
>
Parameters
Name | Type |
---|---|
selector? | null | MediaStreamTrack |
Returns
Promise
<RTCStatsReport
>
Inherited from
negotiate
▸ negotiate(): Promise
<void
>
Returns
Promise
<void
>
receiveAnswer
▸ receiveAnswer(answer
): Promise
<void
>
Parameters
Name | Type |
---|---|
answer | RTCSessionDescriptionInit |
Returns
Promise
<void
>
receiveIceCandidate
▸ receiveIceCandidate(candidate
): Promise
<void
>
Parameters
Name | Type |
---|---|
candidate | RTCIceCandidate | RTCIceCandidateInit |
Returns
Promise
<void
>
receiveOffer
▸ receiveOffer(offer
): Promise
<void
>
Parameters
Name | Type |
---|---|
offer | RTCSessionDescriptionInit |
Returns
Promise
<void
>
releaseLocalICECandidatesBuffer
▸ releaseLocalICECandidatesBuffer(ignore
): void
Parameters
Name | Type |
---|---|
ignore | boolean |
Returns
void
setLocalStream
▸ setLocalStream(stream
, target
, shouldSyncMedia?
): Promise
<void
>
Parameters
Name | Type |
---|---|
stream | undefined | MediaStream |
target | TransceiverConfigDirectionTuple [] |
shouldSyncMedia? | boolean |
Returns
Promise
<void
>
Inherited from
BasePeerConnection.setLocalStream
setReference
▸ setReference(key
, value
): void
Key/Value pair for referencing logical associations for logging
Parameters
Name | Type | Description |
---|---|---|
key | string | The key for the reference |
value | string | The value for the reference |
Returns
void